﻿using System.Collections.Generic;
using Azure.QPCR;

namespace Azure2Java.QPCRAdapter.Adapter.Entity {

    /**
     * @author zy gws ssc
     * @date 18.12.21
     * @update 19.12.06
     * @decription Program代理类
     */
    public class ProgramBean {
        public Program Program;

        public ProgramBean(int stepNum) {
            Program = new Program((ushort) stepNum);
        }

        public ProgramBean(Program Program) { this.Program = Program; }


        public void setId(byte[] id) { Program.ID = id; }

        public byte[] getId() { return Program.ID; }

        public void setChannels(byte[] channels) { Program.Channels = channels; }

        public byte[] getChannels() { return Program.Channels; }

        public void setPositions(byte[] positions) { Program.Positions = positions; }

        public byte[] getPositions() { return Program.Positions; }

        public void setStepNum(ushort stepNum) { Program.StepNUM = stepNum; }

        public ushort getStepNum() { return Program.StepNUM; }

        public void setHotLidMode(ushort hotLidMode) { Program.HotLidMode = hotLidMode; }

        public ushort getHotLidMode() { return Program.HotLidMode; }

        public void setHotLidTemp(ushort hotLidTemp) { Program.HotLidTemp = hotLidTemp; }

        public ushort getHotLidTemp() { return Program.HotLidTemp; }

        public void setHotLidCloseTemp(ushort hotLidCloseTemp) { Program.HotLidCloseTemp = hotLidCloseTemp; }

        public ushort getHotLidCloseTemp() { return Program.HotLidCloseTemp; }

        public void setExperimentMode(ushort ExperimentMode) { Program.ExperimentMode = ExperimentMode; }

        public ushort getExperimentMode() { return Program.ExperimentMode; }

        public void setSampleVol(ushort sampleVol) { Program.SampleVOL = sampleVol; }

        public ushort getSampleVol() { return Program.SampleVOL; }

        public void setTestZone(ushort testZone) { Program.TestZone = testZone; }

        public ushort getTestZone() { return Program.TestZone; }

        public void setHeaterLine(ushort heaterLine) { Program.HeaterLine = heaterLine; }

        public ushort getHeaterLine() { return Program.HeaterLine; }

        public void setDate(ushort year, byte month, byte day, byte hour, byte minute) {
            Program.SaveYear = year;
            Program.SaveMonth = month;
            Program.SaveDay = day;
            Program.SaveHour = hour;
            Program.SaveMinute = minute;
        }

        public ushort getYear() { return Program.SaveYear; }

        public byte getMonth() { return Program.SaveMonth; }

        public byte getDay() { return Program.SaveDay; }

        public byte getHour() { return Program.SaveHour; }

        public byte getMinute() { return Program.SaveMinute; }

        public void setMeltingCurveMode(byte meltingCurveMode) { Program.MeltingCurveMode = meltingCurveMode; }

        public byte getMeltingCurveMode() { return Program.MeltingCurveMode; }

        public void setMeltingCurveStartTemp(ushort meltingCurveStartTemp) { Program.MeltingCurveStartTemp = meltingCurveStartTemp; }

        public ushort getMeltingCurveStartTemp() { return Program.MeltingCurveStartTemp; }

        public void setMeltingCurveEndTemp(ushort meltingCurveEndTemp) { Program.MeltingCurveEndTemp = meltingCurveEndTemp; }

        public ushort getMeltingCurveEndTemp() { return Program.MeltingCurveEndTemp; }

        public void setMeltingCurveStepResolution(float meltingCurveStepResolution) { Program.MeltingCurveStepResolution = meltingCurveStepResolution; }

        public float getMeltingCurveStepResolution() { return Program.MeltingCurveStepResolution; }

        public void setIdRun(int[] idRun) {
            List<uint> temp = new List<uint>();
            foreach(var item in idRun) {
                temp.Add((uint) item);
            }
            Program.IDRun = temp.ToArray();
        }

        public int[] getIdRun() {
            List<int> result = new List<int>();
            foreach(var item in Program.IDRun) {
                result.Add((int) item);
            }
            return result.ToArray();
        }

        public void setIdSample(int[] idSample) {
            List<uint> temp = new List<uint>();
            foreach(var item in idSample) {
                temp.Add((uint) item);
            }
            Program.IDSample = temp.ToArray();
        }

        public int[] getIdSample() {
            List<int> result = new List<int>();
            foreach(var item in Program.IDSample) {
                result.Add((int) item);
            }
            return result.ToArray();
        }

        public void setSteps(ProgramStepBean[] steps) {
            List<ProgramStep> stepsTemp = new List<ProgramStep>();
            foreach(var item in steps) {
                stepsTemp.Add(item.ProgramStep);
            }
            Program.Steps = stepsTemp.ToArray();
        }

        public ProgramStepBean[] getSteps() {
            List<ProgramStepBean> result = new List<ProgramStepBean>();
            foreach(var item in Program.Steps) {
                result.Add(new ProgramStepBean(item));
            }
            return result.ToArray();
        }

        public void setProgramName(byte[] name) { Program.ProgramName = name; }

        public byte[] getProgramName() { return Program.ProgramName; }

        public void setWorkspace(byte[] workSpace) { Program.Workspace = workSpace; }

        public byte[] getWorkspace() { return Program.Workspace; }

        public void setProgramCRC(uint programCRC) { Program.ProgramCRC = programCRC; }

        public uint getProgramCRC() { return Program.ProgramCRC; }

        public void setNC1(byte nc1) { Program.NC1 = nc1; }

        public byte getNC1() { return Program.NC1; }


        public bool compare(ProgramBean programBean) { return Program.Compare(programBean.Program); }

        public bool isValid() { return Program.IsValid(); }

        public byte[] toArray() { return Program.ToArray(); }
    }
}

